//============================================================================
// Name        : GSP295_Wk3_BinarySearch
// Author      : Ronald Ram
// Version     :
// Copyright   : GSP295 Wk3 Program - BinarySearch
// Description : Tree Implemented as Array, with a Binary Search in C++
//============================================================================


#ifndef BINARY_TREE_H_
#define BINARY_TREE_H_


//#pragma once
#include <iostream>
#include <string>

//#include "ImmutableArray.h"

using namespace std;
//using namespace GSP295_Wk3;



namespace GSP295_Wk3
{
	enum Letter
	{
		a=0, b=1, c=2, d=3, e=4, f=5, g=6, h=7, i=8, j=9, k=10,
		l=11, m=12, n=13, o=14, p=15, q=16, r=17, s=18, t=19, u=20,
		v=21, w=22, x=23, y=24, z=26
	};


	////enum RelationType { LESS, GREATER, EQUAL };
	enum ActionType { INSERT=0, DELETE };

	const int MAX_ITEMS = 10; //Max size of array


	class BinarySeach
	{
	private:
		int size;
		//Position of last element, accessed by GetNextItem()
		//Only ResetList(), GetNextItem, affect curr_position
		////int curr_position;
		string *item;

		void Init();
		void inOrder(string arr[]);


	public:
		BinarySeach();
		virtual ~BinarySeach();

		//RelationType ComparedTo( string item );
		//Operations
		void MakeEmpty();
		bool isFull() const;
		int Length() const;
		int Find(string &item, ActionType action );
		bool Insert( string &item );
		bool Delete( string &item );
		void Print_InOrder();
		//void ResetList();
		//void GetNextstring( string item );
	};
}

#endif /* BINARY_TREE_H_ */